home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
hc
/
dbimport.sit
/
DB Importer
/
card_2840.txt
< prev
next >
Wrap
Text File
|
1988-04-11
|
4KB
|
180 lines
-- card: 2840 from stack: in
-- bmap block id: 0
-- flags: 0000
-- background id: 2586
-- name:
----- HyperTalk script -----
on openCard
hide message
end openCard
-- part 1 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=287 top=52 right=74 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Import Data Base
----- HyperTalk script -----
--to use this button, prepare at least as many card background fields
--as fields separated by tabs of your text data file
-- by Ted Tripp, 4588 CR 523, Bayfield, CO 81122, 303-884-9029
on mouseUp
ask "Import text from which file?"
if it is empty then exit mouseUp
put it into fileName
open file fileName
repeat
read from file fileName until return -- get first record
if it is empty then
doMenu "Delete Card"
close file fileName
exit mouseUp
end if
put it into data
repeat with i = 1 to the number of fields
put offset(tab,data) into num --gets first field (until tab)
if num is 0 then -- last field of record has no tab
put data into field i -- writes last field
delete last char of field i -- deletes return char
if first char of field i is quote then
delete first char of field i
delete last char of field i
end if
exit repeat -- stops
end if
put char 1 to (num - 1) of data into field i -- writes first field
if first char of field i is quote then
delete first char of field i
delete last char of field i
end if
delete char 1 to num of data -- gets rid of field
end repeat
doMenu "New Card"
end repeat
close file fileName
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=287 top=29 right=51 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Set Field Names
----- HyperTalk script -----
--prepare text data file with field headers (names) separated by tabs
--to use this button, prepare at least as many card background fields
--as fields separated by tabs of your text data file
-- by Ted Tripp, 4588 CR 523, Bayfield, CO 81122, 303-884-9029
on mouseUp
ask "Set field names from which file?"
if it is empty then exit mouseUp
put it into fileName
open file fileName
read from file fileName until return --get field headers
if it is empty then
close file fileName
exit mouseUp
end if
put it into fieldNames
repeat with i = 1 to the number of fields
put offset(tab,fieldNames) into num --gets characters until tab
if num is 0 then
set name of field i to fieldNames -- sets last field name, stops
put fieldNames into field i
exit repeat
end if
get char 1 to num - 1 of fieldNames
set name of field i to it
put it into field i
delete char 1 to num of fieldNames
end repeat
close file fileName
choose field tool --ready to adjust fields
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=231 top=31 right=70 bottom=272
-- title width / last selected line: 0
-- icon id / first selected line: 19678 / 19678
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Tell Me About...
----- HyperTalk script -----
on mouseUp
go to card "About…"
end mouseUp
-- part contents for background part 1
----- text -----
Data Base Importer
-- part contents for background part 25
----- text -----
Field 2
-- part contents for background part 26
----- text -----
Field 3
-- part contents for background part 27
----- text -----
Field 4
-- part contents for background part 28
----- text -----
Field 5
-- part contents for background part 29
----- text -----
Six
-- part contents for background part 30
----- text -----
Seven
-- part contents for background part 31
----- text -----
Eight
-- part contents for background part 32
----- text -----
Nine
-- part contents for background part 33
----- text -----
Ten
-- part contents for background part 34
----- text -----
Eleven
-- part contents for background part 35
----- text -----
Twelve
-- part contents for background part 36
----- text -----
Thirteen